package com.crm.CLdriving.ioc;

import java.lang.reflect.Method;

import javax.security.auth.message.callback.PrivateKeyCallback.Request;

import org.apache.catalina.core.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.crm.CLdriving.po.LoginPO;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;



@Api(tags = "IoC测试")
@Controller
@RequestMapping("ceshi")
public class springIoC {
	
	@RequestMapping(value = "ioc",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("ioc测试")
	public String IoCTest(){
		
		ClassPathXmlApplicationContext applicationContext = new	ClassPathXmlApplicationContext("spring.xml");
		LoginPO loginPO = (LoginPO)applicationContext.getBean("ceshi");
		System.out.println("ioc测试："+loginPO.toString());
		return loginPO.toString();
	}

}
